﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace Maticsoft.Web.examRoom
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            string strErr = "";
            if (this.txtexamRoomName.Text.Trim().Length == 0)
            {
                strErr += "考场名称不能为空！\\n";
            }
            if (this.txtexamRoomAddress.Text.Trim().Length == 0)
            {
                strErr += "examRoomAddress不能为空！\\n";
            }
            if (this.txtexamRoomTime.Text.Trim().Length == 0)
            {
                strErr += "考试时间不能为空！\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string examRoomName = this.txtexamRoomName.Text;
            string examRoomAddress = this.txtexamRoomAddress.Text;
            string examRoomTime = this.txtexamRoomTime.Text;

            Maticsoft.Model.examRoom model = new Maticsoft.Model.examRoom();
            model.examRoomName = examRoomName;
            model.examRoomAddress = examRoomAddress;
            model.examRoomTime = examRoomTime;

            Maticsoft.BLL.examRoom bll = new Maticsoft.BLL.examRoom();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功！", "list.aspx");

        }


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
